<template>
    <div class="chat-input flex items-center px-4 py-2 border-t">
      <el-input
        v-model="input"
        placeholder="请输入消息..."
        @keyup.enter="handleSend"
        clearable
        class="flex-1"
        size="large"
      />
      <el-button type="primary" size="large" class="ml-2" @click="handleSend">发送</el-button>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue'
  import { useChatStore } from '@/stores/chatStore'
  const chatStore = useChatStore()
  const input = ref('')
  
  function handleSend() {
    if (!input.value.trim()) return
    chatStore.sendMessage(input.value.trim())
    input.value = ''
  }
  </script>
  
  <style scoped>
  .chat-input {
    background: #fff;
    min-height: 56px;
  }
  </style>
  